home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_09 / saks / genq5.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-12  |  478 b   |  32 lines

  1. Listing 8 - non-inline member function definitions for a generic queue 
  2. using void * and an nested iterator class
  3.  
  4. //
  5. // genq5.cpp - generic queue of void *
  6. // with an iterator class
  7. //
  8.  
  9. #include "genq5.h"
  10.  
  11. void *genq::iterator::next()
  12.     {
  13.     void *pv = 0;
  14.     if (pc != 0)
  15.         {
  16.         pv = pc->element;
  17.         pc = pc->next;
  18.         }
  19.     return pv;
  20.     }
  21.  
  22. void genq::append(void *e)
  23.     {
  24.     // same as in Listing 2
  25.     }
  26.  
  27. int genq::remove(void *&e)
  28.     {
  29.     // same as in Listing 2
  30.     }
  31.  
  32.